package com.manor.paradise.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.manor.common.utils.GlideUtil
import com.manor.common.utils.front
import com.manor.common.utils.frontAndBack
import com.manor.paradise.R
import com.manor.paradise.bean.EmploymentBean
import kotlinx.android.synthetic.main.lyb_item_feed_history.view.*

class LybFeedHistoryAdapter(data: MutableList<EmploymentBean.RecordsBean>?) : BaseQuickAdapter<EmploymentBean.RecordsBean, BaseViewHolder>
(R.layout.lyb_item_feed_history, data) {

    override fun convert(holder: BaseViewHolder, item: EmploymentBean.RecordsBean) {
        GlideUtil.loadImage(item.spiritImgUrl, holder.itemView.sAnimalAvatarIv, 57, 57)

        holder.itemView.sAnimalNameTv.text = item.spiritName
        holder.itemView.sAnimalGrowthTimeTv.text = item.activeDays.frontAndBack("成长周期", "天")
        holder.itemView.sAlreadyOutputTv.text = item.producedCrystalOre.front("已产")
        holder.itemView.sStartTimeTv.text = item.createTime.front("开始时间 ")
        holder.itemView.sEndTimeTv.text = item.invalidDate.front("结束时间 ")


    }
}
